package com.gzs.zhdj.mapper;

import com.gzs.zhdj.domain.dto.PasswordEditDto;
import com.gzs.zhdj.domain.entity.PartyMember;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface PartyMemberMapper {
    @Select("select * from partymemberinfo where id =#{id}")
    PartyMember getBySelfId(Integer id);

    @Update("update partymemberinfo set password = #{newPassword2} where id = #{id}")
    void updatePassword(PasswordEditDto passwordEditDto);

    @Update("update partymemberinfo set image = #{filePath} where id = #{id}")
    void upload(@Param("id") int id, @Param("filePath") String filePath);

    void updateSelfInfo(PartyMember partyMember);

    @Select("select * from partymemberinfo where id = #{id}")
    PartyMember getById(int id);
}
